import Vue from 'vue';
import Router from 'vue-router';
import indexPage from './components/header.vue'
import aboutPage from './views/about.vue'
import pageNotFound from './views/404.vue'
import homePage from './views/home.vue'

import userindexPage from './views/user/index.vue'
import profilePage from './views/user/profile.vue'
import commentPage from './views/user/comment.vue'
import collectPage from './views/user/collect.vue'

import loginPage from './views/user/login.vue'
import registerOkPage from './views/user/registerOK.vue'
import registerPage from './views/user/register.vue'
import resetPasswordPage from './views/user/resetPassword.vue'
import forgetPasswordPage from './views/user/forgetPassword.vue'
import hospitalPage from './views/user/hospital.vue'

import Utils from './utils'
import api from './libs/api'

let userRouter = [
    {
        path:'/',
        name: 'home',
        component: homePage
    },
    {
        path:'/about',
        name: 'about',
        component:aboutPage
    },
    {
        path:'/user/comments',
        name: 'user-comments',
        component:commentPage
    },
    {
        path:'/user/index',
        name: 'user-index',
        component:userindexPage
    },
    {
        path:'/user/profile',
        name: 'user-profile',
        component:profilePage
    },
    {
        path: '/user/collect',
        name: 'user-collect',
        component: collectPage
    },
    {
        path: '/user/hospital',
        name: 'hospital',
        component: hospitalPage
    },
    {
        path:'/user/login',
        name: 'Login',
        component:loginPage
    },
    {
        path:'/user/register',
        name: 'Register',
        component: registerPage
    },
    {
        path:'/user/forgetPassword',
        name: 'ForgetPassword',
        component: forgetPasswordPage
    },
    {
        path:'/user/resetPassword',
        name: 'ResetPassword',
        component: resetPasswordPage
    },
    {
        path:'/user/register/ok',
        name: 'registerOk',
        component: registerOkPage
    },
]



import articleListPage from './views/article/articleList.vue'
import articleDetailPage from './views/article/articleDetail.vue'


let articleRouter = [
    {
        path:'/article/list/:type',
        name: 'articleList',
        component: articleListPage
    },
    {
        path:'/article/:id',
        name: 'articleDetail',
        component: articleDetailPage
    },
]

Vue.use(Router)

let router = new Router({
    routes:[
        ...userRouter, 
        ...articleRouter,
        {
            path:'*',
            name: 'pageNotFound',
            component: pageNotFound
        }
    ]
})
export default router